# -*- coding: utf-8 -*-

import cgi, os, sys
from google.appengine.ext.webapp import template, \
        WSGIApplication
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app


class StaticPages(webapp.RequestHandler):
    def get(self, html):
        path = os.path.join(os.path.dirname(__file__), 'views/iphone/' + html)
        self.response.out.write(template.render(path, None))

class SayHello(webapp.RequestHandler):
    def get(self, html):
        #path = os.path.join(os.path.dirname(__file__), 'views/phone/' + html)
        #self.response.out.write(template.render(path, None))
        print 'Content-Type: text/plain'
        print ''
        print 'Hello, world!'

def main():
    application = webapp.WSGIApplication([('/iphone/(?P<num>.+)',
                                           StaticPages),
                                          ('/phone/',
                                           SayHello),
                                     ], debug=True)
    run_wsgi_app(application)

if __name__ == "__main__":
    main()
